<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="http://apps.bdimg.com/libs/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<div >
    <table border="1">
        <thead>
        <tr>
            <th>id</th>
            <th>userId</th>
            <th>commodityCode</th>
            <th>count</th>
            <th>money</th>

        </tr>
        </thead>
        <tbody id="orderlist">

        </tbody>

    </table>
</div>
<input type="button" value="订单列表" onclick="getData()">
<script>
    function getData() {
        $.get('http://localhost:18888/order/getOrder?userId=fox',function(data){
            console.log(data.data)
            var list = data.data;
            var str = '';
            for(var i=0;i<list.length;i++){
                str +='<tr><th>'+list[i].id+'</th><th>'+list[i].userId+'</th><th>'+list[i].commodityCode+'</th><th>'+list[i].count+'</th><th>'+list[i].money+'</th></tr>';
            }
            $('#orderlist').html(str);
        });
    }
</script>
</body>
</html>
